import Taro, {Component,request,showLoading, redirectTo} from '@tarojs/taro'
import {View, Button,Text, Image,ScrollView, Swiper, SwiperItem, Input,} from '@tarojs/components'
import {connect} from '@tarojs/redux'
import {add,minus,asyncAdd,ooo,re} from '../../actions/counter'
import {imgUrl} from '../../config'
import './tzDetail.scss'

@connect(({
  counter
}) => ({
  counter
}), (dispatch) => ({
  add() {
    dispatch(add())
  },
  dec() {
    dispatch(minus())
  },
  asyncAdd() {
    dispatch(asyncAdd())
  },
  haha() {
    dispatch(ooo(0))
  },
  // re(){
  //   dispatch(re())
  // }
}))


class TzDetail extends Component {

  // config = {
  //   navigationBarTitleText: '首页'
  // }
  constructor(props) {
    super(props)
    this.state = {
      value: "<"
    }
  }

  componentWillMount() {}
  componentDidMount() {

  }
  back() {
    redirectTo({
      url: '/pages/index/index'
    })
  }
  goHfDetail() {
    redirectTo({
      url: '/pages/hfDetail/hfDetail'
    })
  }
  render() {
    return ( 
        <View className = 'index' >
            <View className='head'>
              <Text className='close' onClick={this.back}>{this.state.value}</Text>
              <Text className='name'>帖子</Text>
            </View>
            <View className='top'>
              <View className='cont'>
                最美汽车现世，开启你的欧尚style，重新定义时尚
              </View>
              <View className='ht'>
                <Image src={`${imgUrl}/qz.png`}  className='pic' />
                <View className='qzName'>自驾户外圈子</View>
                <View className='jj'>加精</View>
              </View>
            </View>
            <View className='detail'>
                <View className='detailTop'>
                  <Image src={`${imgUrl}/tou.png`} className='touPic' />
                  <View className='name'>熊猫吃锤子</View>
                  <View className='gz'>+ 关注</View>
                </View>
                <View className='zt'>今天我们讲的主角不再是我们熟悉的GS8，而是长安刚刚发布的欧尚全新7座中大型SUV——COS1°。相对于欧尚品牌而言，COS1°是本次全新品牌形象升级的首款产品。</View>
                <Image src={`${imgUrl}/pic2.png`} className='detailPic' /> 
                <View className='zt'>在数学课本里COS1°数值约等于0.9998，近乎于1。言外之意，长安欧尚全新SUV COS1°是一台无限接近于完美的7座SUV！</View>
                <View className='howTime'>
                  <View className='time'>1小时前</View>
                  <Image src={`${imgUrl}/look.png`} className='look'/>
                  <Text className='text1'>562</Text>
                  <Image src={`${imgUrl}/zan1.png`}  className='zan'/>
                  <Text className='text2'>168</Text>
                </View>
            </View>
            <View className='pl'>
              <View className='tit'>评论</View>
              <View className='list'>
                  <View className='plTop'>
                    <Image src={`${imgUrl}/tou.png`} className='pic'/>
                    <View className='name'>熊猫吃锤子</View>
                    <Image src={`${imgUrl}/zan.png`}  className='zan'/>
                    <Text className='text'>168</Text>
                  </View>
                  <View className='plCont'>全员参加活动，活动非常激烈；全员参加活动，活动非常激烈</View>
                  <View className='plTime'>06-27 11:24 · <Text>回复</Text></View>
              </View>
              <View className='list'>
                  <View className='plTop'>
                    <Image src={`${imgUrl}/tou.png`} className='pic'/>
                    <View className='name'>熊猫吃锤子</View>
                    <Image src={`${imgUrl}/zan.png`}  className='zan'/>
                    <Text className='text'>168</Text>
                  </View>
                  <View className='plCont'>全员参加活动，活动非常激烈</View>
                  <View className='plTime'>06-27 11:24 · <Text className='hf' onClick={this.goHfDetail}>6 回复</Text></View>
              </View>
              <View className='list'>
                  <View className='plTop'>
                    <Image src={`${imgUrl}/tou.png`} className='pic'/>
                    <View className='name'>熊猫吃锤子</View>
                    <Image src={`${imgUrl}/zan.png`}  className='zan'/>
                    <Text className='text'>168</Text>
                  </View>
                  <View className='plCont'>全员参加活动，活动非常激烈</View>
                  <View className='plTime'>06-27 11:24 · <Text>回复</Text></View>
              </View>
            </View>
            <View className='footer'>
              <Input type='text' placeholder='写评论' placeholderClass='xpl' />
              <Image src={`${imgUrl}/pl.png`} className='plPic' />
            </View>
        </View>
    )
  }
}
